package com.example.edu.Controller;

import com.example.edu.Dto.LoginDto;
import com.example.edu.Dto.RegisterDto;
import com.example.edu.Dto.Result;
import com.example.edu.Service.UserService;
import com.example.edu.Service.ipml.UserServiceImpl;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    UserService userService;

    @PostMapping("/login")
    public Result login(@RequestBody LoginDto loginData){
        return userService.login(loginData);
    }

    @PostMapping("/register")
    public Result register(@RequestBody RegisterDto registerData){
        return userService.register(registerData);
    }
}
